/*!
\copyright  Copyright (c) 2021 - 2022 Qualcomm Technologies International, Ltd.\n
            All Rights Reserved.\n
            Qualcomm Technologies International, Ltd. Confidential and Proprietary.
\version    %%version
\file       usb_dongle_config.h
\brief      Application configuration file
*/
#include "rssi_pairing.h"
#include "sink_service.h"
#include "profile_manager.h"

#ifndef USB_DONGLE_CONFIG_H_
#define USB_DONGLE_CONFIG_H_

/*! The maximum number of paired devices supported by the application.
    Used to determine the Trusted Device List (TDL) size.
    \note The connection library places an upper limit of 8 devices on this.
*/
#define APP_CONFIG_MAX_PAIRED_DEVICES 8

/*! \name Initial Application Upgrade Version
    Factory-default upgrade version of this app. After a successful upgrade,
    the upgrade version from the upgrade file header will be used instead.
    @{
*/
#define APP_CONFIG_INITIAL_UPGRADE_VERSION_MAJOR 1
#define APP_CONFIG_INITIAL_UPGRADE_VERSION_MINOR 0
/*! @} */

/*! Initial Persistant Store (PS) data config version.
    Factory-default PS data config version of this app. After a successful upgrade,
    the PS config version from the upgrade file header will be used instead.
*/
#define APP_CONFIG_INITIAL_PS_DATA_CONFIG_VERSION 1

/*! \name Sink Service Configuration Items
    @{
*/

/*! Maximum number of seconds to attempt reconnection to a previously paired sink.
	The page timeout ranges from 1 to 40 seconds.
	Pairing may fail to complete if the value is below 5.
*/
#define APP_CONFIG_PAGE_TIMEOUT_S 10
/*! @} */

/*! \name Inquiry Parameters
    @{
*/

/*! Maximum number of devices to consider per inquiry window.
	The inquiry responses ranges from 1 to 255 devices.
*/
#define APP_CONFIG_INQUIRY_MAX_RESPONSES 20
/*! Duration of each inquiry window, in units of 1.28s.
	The inquiry timeout ranges from 1 to 48 (in units of 1.28s).	
*/
#define APP_CONFIG_INQUIRY_TIMEOUT 10
#define APP_CONFIG_INQUIRY_COD_FILTER (AUDIO_MAJOR_SERV_CLASS) /*!< Limit results to a certain Class of Device (COD). */
/*! @} */

/*! \name RSSI Pairing Parameters
    @{
*/

/*! Devices below this RSSI value will not be considered for pairing.
	The RSSI threshold ranges from -127 to +20dBm.
*/
#define APP_CONFIG_RSSI_PAIRING_RSSI_THRESHOLD -60
/*! Minimum RSSI gap between 1st and 2nd devices in the scan list, to avoid ambiguity.
	The RSSI gap can range from 0 to 147dBm.
*/
#define APP_CONFIG_RSSI_PAIRING_MIN_RSSI_GAP 5
#define APP_CONFIG_RSSI_PAIRING_INQUIRY_PARAM_SET 0 /*!< Set of inquiry parameters to use for RSSI pairing (index into inquiry_params_set). */
/*! Maximum number of inquiry window iterations to perform during RSSI pairing.
	The inquiry count ranges from 0 to 65535.
*/
#define APP_CONFIG_RSSI_PAIRING_INQUIRY_COUNT 10
/*! @} */

/*! \name AptX Adaptive Latency Configuration
    @{
*/
#define APP_CONFIG_LATENCY_TARGET_APTX_AD_LL_USB_TO_HS      45  /*!< Latency for aptX Adaptive LL mode, USB input, Headset output */
#define APP_CONFIG_LATENCY_TARGET_APTX_AD_LL_USB_TO_TWM     65  /*!< Latency for aptX Adaptive LL mode, USB input, TWM output */
#define APP_CONFIG_LATENCY_TARGET_APTX_AD_LL_ANALOG_TO_HS   45  /*!< Latency for aptX Adaptive LL mode, Analog input, Headset output */
#define APP_CONFIG_LATENCY_TARGET_APTX_AD_LL_ANALOG_TO_TWM  65  /*!< Latency for aptX Adaptive LL mode, Analog input, TWM output */
#define APP_CONFIG_LATENCY_TARGET_APTX_AD_HQ_MODE           250 /*!< Latency for aptX Adaptive HQ mode (all inputs, all sink types) */
/*! @} */

/*! \name Optional Application Configuration Items
    @{
*/

/*! \def DISCONNECT_ON_USB_SUSPEND
    Disconnect all devices, and prevent connections, when USB goes into suspend mode.
*/
#ifndef APP_CONFIG_DISCONNECT_ON_USB_SUSPEND
#define APP_CONFIG_DISCONNECT_ON_USB_SUSPEND FALSE
#endif

/*! @} */

extern const rssi_pairing_parameters_t usb_dongle_config_rssi_params;
extern const profile_t usb_dongle_config_profile_list[];

#endif /* USB_DONGLE_CONFIG_H_ */
